home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / Technical.Notes / GSOS / TN.GSOS.008 < prev    next >
Encoding:
Text File  |  1989-08-21  |  5.5 KB  |  115 lines  |  [TEXT/pdos]

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6.  
  7. GS/OS
  8. #8:    Filenames With More Than CAPS and Numerals
  9.  
  10. Written by:    Matt Deatherage                                      July 1989
  11.  
  12. This Technical Note discusses the problems some applications may have when 
  13. dealing with filenames containing lowercase letters for the first time.
  14. _____________________________________________________________________________
  15.  
  16. With  System Software 5.0, lowercase filenames enter GS/OS en masse for the 
  17. first time.  Lowercase filenames are inherent to the AppleShare filing system 
  18. and have been added to the ProDOS filing system through the ProDOS FST.  
  19. However, since Apple II filing systems never had lowercase characters in 
  20. filenames before, this change undoubtedly causes problems for some 
  21. applications.  This Note gives general guidelines to help developers avoid 
  22. such problems.
  23.  
  24.  
  25. How the ProDOS FST Does It
  26.  
  27. "Wait," you say (not for any particular reason, other than a general fondness 
  28. for monosyllables).  "If you put lowercase characters in the ProDOS directory 
  29. entry, it's going to cause all kinds of problems.  What's gonna' happen on ][+ 
  30. machines?"
  31.  
  32. Two previously unused bytes in each file's directory entry are now used to 
  33. indicate the case of a filename.  The bytes are at relative locations +$1C and 
  34. +$1D in each directory entry, and were previously labeled version and 
  35. min_version.  Since ProDOS 8 never actually used these bytes for version 
  36. checking (except in one case, discussed below), they are now used to store 
  37. lowercase information.  (In the Volume header, bytes +$1A and +$1B are used 
  38. instead.)
  39.  
  40. If version is read as a word value, bit 7 of min_version would be the highest 
  41. bit (bit 15) of the word.  If that bit is set, the remaining 15 bits of the 
  42. word are interpreted as flags that indicate whether the corresponding 
  43. character in the filename is uppercase or lowercase, with set indicating 
  44. lowercase.  For example, the filename Desk.Accs has a value in this word of 
  45. $B9C0, or binary 1011 1001 1100 0000.  The following illustration shows the 
  46. relationship between the bits and the filename:
  47.  
  48.         Bits in WORD:                   1011100111000000
  49.         Filename:                       Desk.Accs
  50.         Uppercase or Lowercase:         ULLLUULLL
  51.  
  52. Note that the period (.) is considered an uppercase character.
  53.  
  54.  
  55. What it Means
  56.  
  57. Because no lowercase ASCII characters are actually stored in the filename 
  58. fields of the directory entries, all ProDOS 8 software should continue to work 
  59. correctly with disks containing files with lowercase characters in the 
  60. filenames.  Neither ProDOS 8 nor the ProDOS FST are case sensitive when 
  61. searching for filenames:  ProDOS is the same file as PRODOS is the same file 
  62. as prodos.
  63.  
  64. The main trouble applications have is when a filename has been "processed" by 
  65. the application before passing it to GS/OS.  For example, if a command shell 
  66. automatically converts filenames to all uppercase characters before passing 
  67. them to ProDOS 16, the chosen uppercase and lowercase combination for the 
  68. filename will never be seen by the user without any apparent reason.  Some 
  69. developers have considered it okay to ignore lowercase considerations, 
  70. thinking that they would only apply to file systems other than ProDOS (and 
  71. file systems which would not be available on the Apple II for a long time, if 
  72. ever).  These developers were mistaken.
  73.  
  74. A more pressing problem is that of an application that is looking for a 
  75. specific file, perhaps a data file or a configuration file.  If the 
  76. application simply passes a pathname to GS/OS and asks for that file to be 
  77. opened, it will be opened if it exists.  The case of the filename is 
  78. irrelevant since file systems are not case sensitive.  However, if the 
  79. application makes GetDirEntry calls on a specific directory, looking for the 
  80. filename in question, there could be trouble:  the application won't find the 
  81. file unless its string comparison routine is not case sensitive.  If the user 
  82. has renamed the file MyApp.Config, and the string comparison is looking for 
  83. MYAPP.CONFIG, then the application will report that the file does not exist.
  84.  
  85. It is repeated here that when dealing with normal OS considerations, it's 
  86. almost always better to ask for something and respond intelligently if it's 
  87. not there than it is to go looking for it yourself.  The OS already has a lot 
  88. of code to look for things (or expand pathnames, or examine access privileges, 
  89. etc.), and reinventing the wheel is not only tedious, it can be detrimental to 
  90. future compatibility.
  91.  
  92.  
  93. The One Exception
  94.  
  95. In the past, ProDOS 8 did look at the version bytes when opening a 
  96. subdirectory.  The code to do this has been removed from ProDOS 8 V1.8.  
  97. Please be aware that earlier versions of ProDOS 8 will be unable to scan 
  98. subdirectories with lowercase characters in the directory name, even to find 
  99. files in those directories.
  100.  
  101.  
  102. Conclusion
  103.  
  104. Most user-input routines (including the Standard File tool set) return 
  105. filenames or pathnames that can be passed directly to GS/OS without 
  106. preprocessing.  Doing so may return "pathname syntax errors" more often than 
  107. not doing so, but it also enables applications to take advantage of future 
  108. versions of the System Software that loosen the restrictions on syntax (or new 
  109. file systems that never had such restrictions).  Under GS/OS, even ProDOS 
  110. disks aren't what they used to be.
  111.  
  112.  
  113. Further Reference
  114. _____________________________________________________________________________
  115.     o    GS/OS Reference